<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0, minimum-scale=1.0, user-scalable=0, initial-scale=1.0, width=device-width" />
    <meta name="format-detection" content="telephone=no, email=no, date=no, address=no">
    <title>工单</title>
    <link rel="stylesheet" type="text/css" href="../css/mui.min.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css"/>
	<style type="text/css">
    	.detail{
    		padding-right: 20px!important;
    	}
    	h5{color: #0062CC;}
    	.mui-navigate-right .mui-col-xs-8{
		    width: 62.666667%!important;
    	}
    	.mui-text-right input{
    		border: 0;
    		font-size: 14px;
		    font-weight: 400;
		    color: #8f8f94;
    		margin-bottom: 0;
    		text-align: right;
    	}
    </style>
</head>

<body>
    <div class="mui-content" id="ordrListsContent">
    	<script type="text/template" id="itemslist">
			{{each datas as item i}}
		<div class="mui-card">
			<ul class="mui-table-view mui-table-view-chevron">
				<li class="mui-table-view-cell mui-collapse">
					<a class="mui-navigate-right" href="#">服务：{{item.itemnum}}
						<span class="mui-badge mui-badge-inverted">数量:{{item.itemqty}}</span>
					</a>
					<ul class="mui-table-view mui-table-view-chevron">
						<li class="mui-table-view-cell">任务：{{item.taskDesc}}</li>
						<li class="mui-table-view-cell">单位成本：{{item.unitcost}}</li>
						<li class="mui-table-view-cell">行成本：{{item.linecost}}</li>
						<li class="mui-table-view-cell">描述：{{item.description}}</li>
					</ul>
				</li>
			</ul>
			<div class="mui-card-footer">
				<a class="mui-card-link" tapmode onclick="openSaveWin('work_order_manage_servicePlan_edit','修改实际服务', {wpitemid: {{item.wpitemid}}, wonum: api.pageParam.wonum})">修改实际服务</a>
				<a class="mui-card-link"></a>
				<a class="mui-card-link" tapmode onclick="Delete('deleteServiceTrans',{servrectransid: {{item.wpitemid}}})">删除</a>
			</div>
		</div>
		{{/each}}
        </script>
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script src="../script/mui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/common.js" type="text/javascript" charset="utf-8"></script>
<script src="../script/template.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
	var cRegion = '', assetnum = '', userID = '',statusId;
	apiready = function () {
		onLoadData(curPage,false);
		scrollToBottomHandler(function() {
			if (!loadEnd) { // 没有结束时继续加载
				curPage++;
				onLoadData(curPage,true);
			} else { // 告诉到底了
				EndToast('到底了');
			}
		})
		Refresh(function() {
			loadEnd = false;
			curPage = 1;
			onLoadData(curPage,false);
		});
		api.addEventListener({
            name: 'refersh'
        }, function(ret, err) {
        	if (ret.value.isrefersh == 'yes') {
        		loadEnd = false;
				curPage = 1;
				onLoadData(curPage,false);
        	}
        });
		api.addEventListener({
		    name:'navitembtn'
		},function(ret, err){
		    if(ret.type == 'right'){
		    	openSaveWin('work_order_manage_servicePlan_add','添加实际服务', {
		    		linetype: api.pageParam.linetype,
		    		wonum: api.pageParam.wonum,
		    		add: 'actual'
		    	});
		    }
	  })
		api.parseTapmode();
	}
	function onLoadData (page,load) {
		ajaxrd("queryServiceTransList", {
			wonum: api.pageParam.wonum,
			pageNo: curPage,
			pageSize: 10
		}, function(ret, err) {
			api.refreshHeaderLoadDone();
			if (ret.list) {
				AddData('itemslist','ordrListsContent',ret.list,load);
				if (ret.list.length < 10) {
					loadEnd = true
				}
			} else {
				Toast('暂无数据');
			}
		})
	}
</script>

</html>
